package model

import (
	"goods_srv/work/global"
	"gorm.io/gorm"
)

type Goods2 struct {
	gorm.Model
	GoodsName      string
	GoodsPrice     int
	GoodsStock     string
	GoodsUrl       string
	GoodsIntroduce string
	GoodsShing     int
	GoodsStatus    int
	GoodsSort      int
}

func (g Goods2) Search(name string) (goods Goods2, err error) {

	global.Db.Table("goods2").Where("goods_name like ?", name).First(&goods)

	return goods, err
}
